﻿using BarManager.Core.DomainModel;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;
using System;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace BarManager.Infrastructure.Data.Repository
{
    public class EmpleadoRepository : BaseRepository<Empleado>, IEmpleadoRepository
    {
        public EmpleadoRepository(IObjectContext context)
            : base(context)
        {           
        }

        public override Empleado Get(Expression<Func<Empleado, bool>> condition)
        {
            return base.Context.Query<Empleado>()
                .Include(x => x.Cargo)
                .FirstOrDefault(condition);
        }       
    }
}
